<?php

use yii\db\Migration;

/**
 * Handles the creation of table `information`.
 */
class m171124_074032_create_information_table extends Migration
{
    /**
     * @inheritdoc
     */
    public function up()
    {
        $this->createTable('information', [
            'id' => $this->primaryKey(),
            'type' => $this->smallInteger(5)->notNull()->comment('类型'),
            'title' => $this->string(255)->notNull()->comment('类型'),
            'cover_img' => $this->string(100)->comment('图片'),
            'content' => $this->string(100)->notNull()->comment('内容'),
            'commentcount' => $this->string(100)->comment('评论数'),
            'browsecount' => $this->string(100)->comment('浏览量'),
            'top' => $this->smallInteger(5)->comment('置顶'),
            'status' => $this->integer(11)->comment('状态 0关闭 1开启 '),
            'created_at' => $this->integer()->unsigned()->notNull()->comment('创建时间'),
            'updated_at' => $this->integer()->unsigned()->notNull()->comment('更新时间'),
        ]);
    }

    /**
     * @inheritdoc
     */
    public function down()
    {
        $this->dropTable('information');
    }
}
